import { Map } from "immutable";
import * as actionTypes from "./constance";

const defaultState = Map({
  mvDetailR: [],
  mvDetailInfoR: [],
  mvUrlR: [],
  mvCommentR: [],
  allVideo: [],
});

const mvR = (state = defaultState, action) => {
  switch (action.type) {
    case actionTypes.GET_MV_DETAIL:
      return state.set("mvDetailR", action.mvDetails);
    case actionTypes.GET_MV_DETAIL_INFO:
      return state.set("mvDetailInfoR", action.mvDetailInfo);
    case actionTypes.GET_MV_URL:
      return state.set("mvUrlR", action.mvUrl);
    case actionTypes.GET_MV_COMMENT:
      return state.set("mvCommentR", action.mvComments);
    case actionTypes.GET_MV_ALLVEDIO:
      return state.set("allVideo", action.allVideo);
    default:
      return state;
  }
};

export default mvR;
